package bean;

/**
 * Description:
 *
 * @author jiangbang
 * @version 1.0
 * @date: 2018年01月25日
 * @since JDK 1.8
 */
public class Facts {

    private final int page;
    private final int pageSize;
    private final int startRow;
    private final int endRow;


	public static class Builder {
		private final int startRow;
		private final int endRow;
		private int page;
		private int pageSize;

		public Builder(int startRow, int endRow) {
			this.startRow = startRow;
			this.endRow = endRow;
		}

		public Builder setPage(int page) {
			this.page = page;
			return this;
		}

		public Builder setPageSize(int pageSize) {
			this.pageSize = pageSize;
			return this;
		}

		public Facts build() {
			return new Facts(this);
		}
	}

    public Facts(Builder builder) {
        this.page = builder.page;
        this.pageSize = builder.pageSize;
        this.startRow = builder.startRow;
        this.endRow = builder.endRow;
    }

    public Facts(int page, int pageSize, int startRow, int endRow) {
        this.page = page;
        this.pageSize = pageSize;
        this.startRow = startRow;
        this.endRow = endRow;
    }

    @Override
    public String toString() {
        return "Facts{" +
                "page=" + page +
                ", pageSize=" + pageSize +
                ", startRow=" + startRow +
                ", endRow=" + endRow +
                '}';
    }
}
